<template>
     <div class="box">
      <div class="header">
         <van-nav-bar
        title="我的"
     
        left-arrow
        @click-left="$router.back()"
      />
      </div>
      <div class="main">
        <div class="user">
            <p>用户名:{{username}}</p>
            <van-button type="primary" @click="loginout">退出</van-button>
        </div>
      </div>
      </div>
</template>

<script setup>
import {useRouter} from 'vue-router'
const  router = useRouter()
const username = localStorage.getItem('username')
const loginout=()=>{
    localStorage.removeItem('token')
     localStorage.removeItem('username')
     router.push('/')
}
</script>
